# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=exe2image
pkgver=1.1
pkgrel=1
pkgdesc='A simple utility to convert EXE files to JPEG images and vice versa.'
url='https://github.com/OsandaMalith/Exe2Image'
groups=('blackarch' 'blackarch-backdoor' 'blackarch-binary')
license=('custom:unknown')
arch=('any')
depends=('java-environment')
source=('https://github.com/OsandaMalith/Exe2Image/releases/download/1/Exe2Image.7z')
sha512sums=('9b41af481ffe3eb64f9dd451d363b26614f5ed0ff3fa26b465da97291ec5c9e11b8668c20b3c7ca0b2d3c98c9e28b60de5fbb6677c0866fd37ae50d2157c3cfd')

package() {
  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 Exe2Image.jar "$pkgdir/usr/share/$pkgname/Exe2Image.jar"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec java -jar /usr/share/$pkgname/Exe2Image.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

